<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>

<script language="javascript" type="text/javascript">

function check()
{
	var b1,b2,b3,b4,b5,b6,b7;
	
  	var namevalid=/^[a-zA-Z ]+$/;
  

        b1= document.f4.bankname.value;
        if(b1.length==0)
        {
        	alert("Enter Bank Name");
            return false;
      	}
        else if(b1.search(namevalid)==-1)
        {
            alert("Please Enter valid name");
            document.f4.bankname.value="";
            document.f4.bankname.focus();
            
	         return false;
    	 }
        
        b2= document.f4.bankaddress.value;
        if(b2.length==0)
        {
        	alert("Please Enter Branch Address");
            return false;
      	}
        
	    b4= document.f4.accountnumber.value;
        if(b4.length == 0)
        {
            alert("Please Enter Account Number");
            return false;
        }

	    b5= document.f4.ifcscode.value;
        if(b5.length == 0)
        {
            alert("Please Enter IFCS Code");
            return false;
        }

	    b6= document.f4.micrcode.value;
        if(b6.length == 0)
        {
            alert("Please Enter MICR Code");
            return false;
        }

        b7= document.f4.bopeningbalance.value;
        if(b7.length == 0)
        {
             alert("Please Enter Opening Balance");
             return false;
        }
         
        if(!b7.match(/^\d+$/))
      	{
       		alert("Please Enter Opening Balance in Numerics only");
            return false;
      	 }

             return true;
    }

</script>

</head>
<body>

<form name="f4" action="BankMasterServlet" ONSUBMIT="return check()">
<center> <h2> Bank Master Creation </h2></center>
<table border=0 align="center">

<tr>
	<td> Name of the Bank </td>
	<td> <input type="text" name="bankname"></td>
</tr>

<tr>
	<td> Branch Address </td>
	<td> <input type="text" name="bankaddress"></td>
</tr>

<tr>
	<td> Bank Account type</td>
	<td> <select name="accounttype" id="acounttype">
			<option> </option>
			<option> Current </option>
			<option> Saving </option>
		</select>
	</td>
</tr>

<tr>
	<td> Bank Account Number </td>
	<td> <input type="text" name="accountnumber"></td>
</tr>

<tr>
	<td> IFCS Code </td>
	<td> <input type="text" name="ifcscode"></td>
</tr>

<tr>
	<td> MICR Code </td>
	<td> <input type="text" name="micrcode"></td>
</tr>

<tr>
	<td> Opening Balance </td>
	<td> <input type="text" name="bopeningbalance"></td>
</tr>

<tr>
	
	<td> <input type="submit" name="enter" value="Submit"> </td>
</tr>

</table>
</form>

</body>
</html>
